import { getCurrentRouteAuth, hasAuth } from "@/utils/auth";
import {useRoute} from "vue-router";

export const useMixinAuth = () => {
  const route = useRoute()
  const idx=route.matched[0].children.findIndex(r => r.path === route.path)
  return route.matched[0].children[idx].auth;   
}

export default {
  name: 'Auth',
  data() {
    return {
      auth: getCurrentRouteAuth()
    }
  },
  methods: {
    hasAuth
  }
}
